﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBManager.AppCommon.Helper;
using System.Data;
using DBManager.ChamCong.Entities;
namespace DBManager.ChamCong.DAL
{
    class ChamCong_DAL
    {
        public ChamCong_DAL()
        {

        }
        public void ChamCong_Add(ChamCong_Ent ChamCong)
        {
            try
            {
                SQLHelper.ExecuteNonQuery("sp_ChamCong_Add", CommandType.StoredProcedure,
                                                    new Param("@GiaoVienID", ChamCong.GiaoVienID),
                                                    new Param("@GioVao", ChamCong.GioVao),
                                                    new Param("@GioVao_So", ChamCong.GioVao_So),
                                                    new Param("@GioRa", ChamCong.GioRa),
                                                    new Param("@GioRa_So", ChamCong.GioRa_So),
                                                    new Param("@Ngay", ChamCong.Ngay),
                                                    new Param("@Ngay_So", ChamCong.Ngay_So),
                                                    new Param("@Tuan", ChamCong.Tuan),
                                                    new Param("@Thang", ChamCong.Thang),
                                                    new Param("@Nam", ChamCong.Nam),
                                                    new Param("@GhiChu", ChamCong.GhiChu),
                                                    new Param("@NgayTao", ChamCong.NgayTao),
                                                    new Param("@NguoiTao", ChamCong.NguoiTao),
                                                    new Param("@NgaySua", ChamCong.NgaySua),
                                                    new Param("@NguoiSua", ChamCong.NguoiSua));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List<ChamCong_Ent> ChamCong_GetItems(int NgayBatDau,int NgayKetThuc)
        {
            try
            {
                return SQLHelper.GetEntities<ChamCong_Ent>("[sp_ChamCong_GetItems]", CommandType.StoredProcedure,
                                                     new Param("@NgayBatDau", NgayBatDau),
                                                     new Param("@NgayKetThuc", NgayKetThuc));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
